<%--
  Created by IntelliJ IDEA.
  User: naojiang
  Date: 2017/7/13
  Time: 9:06
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<html>
<head>
    <title>权限管理系统</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="css/login.css">
    <link rel="stylesheet" href="css/bootstrapValidator.css">
    <link href="css/bootstrapValidator.min.css" rel="stylesheet" />
</head>
<body>
<div id="page">
<img src="image/p0.jpg" alt="">
<div class="overlay"></div>
</div>
<div class="container">
    <div class="container-content">
        <div id="login" class="row">
            <div class="col-md-4 col-md-push-8">
                <div class="form-wrap">
                        <div class="tab">
                        <div class="tab-content">
                            <div class="tab-content-inner active" >
                                <h3 class="cursive-font text-center">权限管理系统</h3>
                                <form class="form-group" id="form1" name="form1" action="/user/login" method="post">
                                    <div class="row form-group">
                                        <div class="col-md-12">
                                            <label for="username">用户名</label>
                                        </div>
                                        <div class="col-md-12">
                                            <span class="glyphicon glyphicon-user form-control-feedback small-graph"></span>
                                            <input type="text" name="username" class="form-control" placeholder="输入用户名">
                                        </div>
                                    </div>
                                    <div class="row form-group">
                                        <div class="col-md-12">
                                            <label for="password">密码</label>
                                        </div>
                                        <div class="col-md-12">
                                            <span class="glyphicon glyphicon-lock form-control-feedback small-graph"></span>
                                            <input type="password" name="password" class="form-control"
                                                   placeholder="输入密码">
                                        </div>
                                    </div>
                                    <div class="row form-group">
                                        <div class="col-md-12">
                                            <label for="name">身份</label>
                                        </div>
                                        <div class="col-md-12">
                                            <span class="glyphicon glyphicon-user form-control-feedback small-graph"></span>
                                            <input type="radio" name="name" value="administrator" checked>管理员
                                            <input type="radio" name="name" value="normaluser">一般用户</input>
                                        </div>
                                    </div>
                            </div>
                            <div class="row form-group button-group">
                                <div class="col-md-12">
                                    <input type="submit" class="btn btn-success btn-block" value="登录" id="enter">
                                </div>
                            </div>

                            </form>
                        </div>


                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</div>
<script src="js/jquery-3.0.0.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/bootstrapValidator.js"></script>
<script src="js/language/zh_CN.js"></script>
<script src="js/jquery.js"></script>
<script src="js/bootstrapValidator.min.js"></script>
<script type='text/javascript'>
    //var form = $('#form1');
    //$(document).ready(function () {

    $('#form1').bootstrapValidator({
        message: '输入值不合法',
        feedbackIcons: {
            valid: 'glyphicon glyphicon-ok',
            invalid: 'glyphicon glyphicon-remove',
            validating: 'glyphicon glyphicon-refresh'
        },
        fields: {
            username: {
                message: '用户名不合法',
                validators: {
                    notEmpty: {
                        message: '用户名不能为空'
                    },
                    stringLength: {
                        min: 3,
                        max: 30,
                        message: '请输入3到30个字符'
                    },
                    regexp: {
                        regexp: /^[a-zA-Z0-9_\. \u4e00-\u9fa5 ]+$/,
                        message: '用户名只能由字母、数字、点、下划线和汉字组成 '
                    }
                }
            },
            password: {
                validators: {
                    notEmpty: {
                        message: '*密码不能为空'
                    }
                }
            },
            name: {
                validators: {
                    notEmpty: {
                        message: '*角色不能为空'
                    }
                }
            }
        }
    });
    //});
    $("#enter").click(function(e){
        $('#form1').bootstrapValidator('validate');
        var bootstrapValidator = $("#form1").data('bootstrapValidator');
        if(bootstrapValidator.isValid()) {
            bootstrapValidator.defaultSubmit();
        }
    });
</script>
</body>
</html>
